Control your application with states

In Kanzi Studio use the State Tools to create, define, and manage states in your application.

Use states to define the look and behavior of your Kanzi application in different states. For example, you can use states to:

Create states in your application

  1. In the Project create a Button 3D node and add to it a Plane node.
    You create a state manager in the Button 3D node to change the rotation of the Plane node when the Button 3D node is pressed.
  2. In the Project select the Button 3D node and in the State Tools click .
    Kanzi Studio creates a new state manager and assigns it to the selected node.
  3. In the State Tools click to create a state.
  4. In the State Tools double-click the name of the state and enter a new name for the state.
    For example, name the state Pressed.
  5. In the Preview click Edit and use the Node tool to set the rotation of the Plane node when the button is pressed.
  6. In the State Tools click to save the current values to that state.
  7. Repeat the previous three steps to create a state when the button is not pressed.
    When you click a state in the State Tools, you can see in the Preview what the nodes controlled by that state manager look like in that state.

  8. In the State Tools click <No Controller Property> and in the context menu select Button > Is Down.
    In a state manager the value of the property you select as the Controller Property defines the conditions when each state in a state group is active. Here you use the Is Down property to transition to a state based on the value of that property.

  9. In the State Tools set the value of the Controller Property in the Pressed state to True. By doing so your Kanzi application uses the Pressed state when the button is pressed and the Released state when the button is not pressed.
  10. In the State Tools click Active to deactivate the State Tools.
    When you want to try out in the Preview how the state manager works in your application you need to turn the State Tools off.

  11. In the Preview click Edit to exit the Edit mode and click the Plane node. When you click the Plane node and hold down the mouse button you enter the Pressed state. When you release the mouse button you enter the Released state. The state manager uses the default transitions to transition between states. See Setting the transitions between states.

Learn about the state manager >

< Import content to your project

Animate your application >